﻿using LP;
using UnityEngine;
public static class Global
{
    //游戏配置数据管理器
    public static GameConfigMgr GameConfigMgrIns { get; set; }
    //管理可以接受关闭信号量的Mgr
    public static CancleTokenMgr CancleTokenMgrIns { get; set; }
    //携程管理器
    public static CoroutineMgr CoroutineMgrIns { get; set; }
    //时间管理器
    public static TimeMgr TimeMgrIns { get; set; }
    //游戏设置管理器
    public static GameSettingMgr GameSettingMgrIns { get; set; }
    //网络管理器
    public static WebNetMgr NetMgrIns { get; set; }
    //资源管理器
    public static ResMgr ResMgrIns { get; set; }
    //音频管理器
    public static AudioMgr AudioMgrIns { get; set; }
    //窗口管理器
    public static WindowMgr WindowMgrIns { get; set; }
    //游戏数据管理器
    public static ModelMgr ModelMgrIns { get; set; }
    //通知场景消息
    public static EventSys SceneEventHandler { get; } = new EventSys();
    //通知UI相关消息
    public static EventSys UIEventHandler { get; } = new EventSys();
    //通知系统相关消息
    public static EventSys SysEventHandler { get; } = new EventSys();
    //通知网络消息
    public static EventSys NetEventHandler { get; } = new EventSys();
    //主Monobehaviour
    public static MonoBehaviour MainBehaviour { get; set; }
    /// <summary>
    /// UICamera
    /// </summary>
    /// <value></value>
    public static Camera UICamera
    {
        get
        {
            return GLModuleMgr.Ins.RetriveModule<GlobleModule>().RetrieveMgr<UIMgr>().UICamera;
        }
    }

    /// <summary>
    /// 返回UICanvas
    /// </summary>
    /// <param name="uIType"></param>
    /// <returns></returns>
    public static UnityEngine.RectTransform GetUICanvas(EUIType uIType)
    {
        return GLModuleMgr.Ins.RetriveModule<GlobleModule>().RetrieveMgr<UIMgr>().GetUICanvas(uIType) as RectTransform;
    }
}
